Repository navigation
feat: accept a precompiled check in the worker's getOptions - #261
alexander-akait wants to merge 4 commits into
Conversation
webpack's getOptions(schema, check) skips the schema when the check passes (webpack/webpack#22745). The worker reimplements getOptions, so a loader running under thread-loader kept compiling its schema. It now takes the same second argument; a failing check still validates fully. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QYPkbvwyRWt2SHgXDoYRdo
|
No actionable comments were generated in the recent review. WalkthroughThe loader-context Merge Risk:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #261 +/- ##
==========================================
- Coverage 14.75% 14.45% -0.30%
==========================================
Files 9 9
Lines 732 747 +15
Branches 166 180 +14
==========================================
Hits 108 108
- Misses 543 553 +10
- Partials 81 86 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fast-uri <= 3.1.7 has high severity advisories (GHSA-v2hh-gcrm-f6hx and others), which fail `npm audit --omit=dev` in the lint job. 3.1.8 is within ajv's ^3.0.1 range, so only the lockfile changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QYPkbvwyRWt2SHgXDoYRdo
|
The lint job's Generated by Claude Code |
Take the check last or in the configuration's place, accept a function returning the schema, name the errors by the configuration, then the schema title, then "Loader", warn when the check rejects options the schema accepts, and load schema-utils only when validating.
Summary
webpack/webpack#22745 adds an optional second argument to
this.getOptions:this.getOptions(schema, check). When the precompiled check passes, webpack skips the schema, soschema-utilsand ajv aren't loaded. Loaders are starting to pass it (webpack/coffee-loader#240, webpack/postcss-loader#746).The worker reimplements
getOptions, so a loader running under thread-loader would still compile its schema in every worker. The worker'sgetOptionsnow takes the same second argument:Tests
test/options-check.test.jsruns a loader through a real worker:src/worker.js.npm run lintand the full suite (17 tests, 6 snapshots) pass locally.Generated by Claude Code
Summary by CodeRabbit